package com.lgh.hotel.vo;

import lombok.Data;

@Data
public class Result {

    private boolean success;

    private int code;

    private String msg;

    private Object data;

    public static Result succ(){
        Result result = new Result();
        result.setCode(20000);
        result.setMsg("success");
        result.setSuccess(true);
        return result;
    }
    public static Result succ(Object data){
        Result result = new Result();
        result.setCode(20000);
        result.setData(data);
        result.setMsg("success");
        result.setSuccess(true);
        return result;
    }

    public static Result fail(String smg){
        Result result = new Result();
        result.setCode(40000);
        result.setData(null);
        result.setMsg(smg);
        result.setSuccess(false);
        return result;
    }

}
